﻿using SD.Infrastructure.EntityBase;
using System;

namespace SlamDunk.MES.Domain.Entities.StockContext
{
    /// <summary>
    /// 物料条码
    /// </summary>
    public class MaterialBarcode : AggregateRootEntity
    {
        #region # 构造器

        #region 00.无参构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        protected MaterialBarcode() { }
        #endregion

        #region 01.创建物料条码构造器
        /// <summary>
        /// 创建物料条码构造器
        /// </summary>
        /// <param name="barcodeNo">物料条码编号</param>
        /// <param name="materialId">物料定义Id</param>
        /// <param name="materialLotId">物料批次Id</param>
        /// <param name="facilityId">工厂模型Id</param>
        /// <param name="quantity">数量</param>
        public MaterialBarcode(string barcodeNo, Guid materialId, Guid? materialLotId, Guid? facilityId, decimal quantity)
            : this()
        {
            base.Number = barcodeNo;
            this.MaterialId = materialId;
            this.MaterialLotId = materialLotId;
            this.FacilityId = facilityId;
            this.Quantity = quantity;
        }
        #endregion

        #endregion

        #region # 属性

        #region 物料定义Id —— Guid MaterialId
        /// <summary>
        /// 物料定义Id
        /// </summary>
        public Guid MaterialId { get; private set; }
        #endregion

        #region 物料批次Id —— Guid? MaterialLotId
        /// <summary>
        /// 物料批次Id
        /// </summary>
        public Guid? MaterialLotId { get; private set; }
        #endregion

        #region 工厂模型Id —— Guid? FacilityId
        /// <summary>
        /// 工厂模型Id
        /// </summary>
        public Guid? FacilityId { get; private set; }
        #endregion

        #region 数量 —— decimal Quantity
        /// <summary>
        /// 数量
        /// </summary>
        public decimal Quantity { get; private set; }
        #endregion

        #endregion
    }
}
